package com.sxsihe.heartmate.util;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by mgxc2 on 15/12/2.
 */
public class UserSharePreferenceUtil {

    private static UserSharePreferenceUtil u;
    private  static SharePreferenceUtil util;
    public static UserSharePreferenceUtil getInstance(Context context){
        if(u==null){
            u= new UserSharePreferenceUtil();
            util = SharePreferenceUtil.getInstance(context);
        }
        return u;
    }

    public void setUser(User u){
        util.set("user_name",u.getName());
        util.set("user_phone",u.getPhone());
        util.set("user_password",u.getPassword());
        util.set("user_birthday",u.getBirthday());
        util.set("user_gender",u.getGender());
        util.set("user_linkman",u.getLinkman());
        util.set("user_linkmanName",u.getLinkmanName());
    }

    public void clear(){
        util.set("user_name","");
        util.set("user_phone","");
        util.set("user_password","");
        util.set("user_birthday","");
        util.set("user_gender","");
        util.set("user_linkman","");
        util.set("user_linkmanName","");
    }

}


class User{
    private String name;
    private String phone;
    private String password;
    private String birthday;
    private String gender;
    private String linkman;
    private String linkmanName;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getLinkman() {
        return linkman;
    }

    public void setLinkman(String linkman) {
        this.linkman = linkman;
    }

    public String getLinkmanName() {
        return linkmanName;
    }

    public void setLinkmanName(String linkmanName) {
        this.linkmanName = linkmanName;
    }
}
